package com.turbo.cloud.ums.web.model.api;

import com.turbo.cloud.core.base.BaseModel;
import com.turbo.cloud.core.validated.InsertValidated;
import com.turbo.cloud.core.validated.UpdateValidated;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * <p>
 * 接口表
 * </p>
 *
 * @author zhangluning
 * @since 2022-10-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Accessors(chain = true)
public class UmsApiDo extends BaseModel {

    /**
     * 主键
     */
    @NotBlank(message = "接口ID不能为空", groups = {UpdateValidated.class})
    private String id;

    /**
     * 菜单ID
     */
    @NotBlank(message = "菜单ID不能为空", groups = {InsertValidated.class, UpdateValidated.class})
    private String menuId;

    /**
     * 接口名称
     */
    @NotBlank(message = "接口名称不能为空", groups = {InsertValidated.class, UpdateValidated.class})
    private String apiTitle;

    /**
     * 接口编码
     */
    @NotBlank(message = "接口编码不能为空", groups = {InsertValidated.class, UpdateValidated.class})
    private String apiCode;

    /**
     * 接口地址
     */
    @NotBlank(message = "接口地址不能为空", groups = {InsertValidated.class, UpdateValidated.class})
    private String apiUrl;

    /**
     * 请求方式（Get,Post,Put,Head,Delete,Options,Trace,Connect）
     */
    @NotBlank(message = "请求方式不能为空", groups = {InsertValidated.class, UpdateValidated.class})
    private String apiHttpMethod;

    /**
     * 请求参数
     */
    private String apiParam;

    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = {InsertValidated.class, UpdateValidated.class})
    private Integer sort;

    /**
     * 备注信息
     */
    private String note;
}
